package com.settlement.system.common.enums;

import com.settlement.system.common.base.IBaseEnum;
import lombok.Getter;

/**
 * 状态枚举
 *
 * @author haoxr
 * @since 2022/10/14
 */
public enum ReceivableBillStatusEnum implements IBaseEnum<Integer> {

    UN_CONFIRM(0, "未确认"),
    CONFIRM_NO_INVOICE(1, "已确认未开票"),
    INVOICE_NO_RECEIVABLE(2, "已开票未收款"),
    RECEIVABLE (99, "已收款");

    @Getter
    private Integer value;

    @Getter
    private String label;

    ReceivableBillStatusEnum(Integer value, String label) {
        this.value = value;
        this.label = label;
    }

    public static String getLabel(int value){
        if(value == 0){
            return UN_CONFIRM.getLabel();
        }else if(value == 1){
            return CONFIRM_NO_INVOICE.getLabel();
        }else if(value == 2){
            return INVOICE_NO_RECEIVABLE.getLabel();
        }else if(value == 99){
            return RECEIVABLE.getLabel();
        }else{
            return UN_CONFIRM.getLabel();
        }
    }
}
